package org.nanfang.lianxi.demo07.t02;

/**
 * @author ZQX
 * @date 2025-03-12
 */
public class MyRunnable implements Runnable {
    /**
     * 电影票 - 50张
     */
    private int ticket = 50;

    @Override
    public void run() {
        while (true) {
            if (ticket <= 0) {
                break;
            }

            String name = Thread.currentThread().getName();
            System.out.printf("票价售出了10%", name, ticket);
            ticket--;
        }
    }
}
